package org.ysh.vo;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@Data
public class IndexInfoVo {

    private HomeInfo homeInfo;

    private LogoInfo logoInfo;

    private List<MenuInfo> menuInfo;

    public static HomeInfo buildHomeInfo(String title,String href){
        HomeInfo homeInfo = new HomeInfo();
        homeInfo.title = title;
        homeInfo.href = href;
        return homeInfo;
    }

    public static LogoInfo buildLogoInfo(String title,String href,String image) {
        LogoInfo homeInfo = new LogoInfo();
        homeInfo.title = title;
        homeInfo.href = href;
        homeInfo.image = image;
        return homeInfo;
    }

    public static MenuInfo buildMenuInfo(String title,String href,String icon) {
        MenuInfo homeInfo = new MenuInfo();
        homeInfo.title = title;
        homeInfo.href = href;
        homeInfo.icon = icon;
        return homeInfo;
    }

    /**
     * 首页信息
     */
    @Data
    public static class HomeInfo {
        //标题
        protected String title;
        //首页
        protected String href;
    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    public static class LogoInfo extends HomeInfo {
        protected String image;
    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    public static class MenuInfo extends HomeInfo {
        protected String icon;
        protected String target="_self";
        protected List<MenuInfo> child;
    }


}
